# 字符串
# s='0100110001010001'
s = 'aaab'
my_set = set()
for i in range(len(s)):
    for j in range(i + 1, len(s) + 1):
        my_set.add(s[i:j])

print(my_set)
print(len(my_set))

# [0:1)='a'  [0:2)='aa' [0:3)='aaa'  [0:4)='aaab'
#           [1:2)='a'   [1:3)='aa'  [1:4)='aab'
#                      [2:3)='a'    [2:4)='ab'
#                                   [3:4)='b'
